package com.example.model;

import android.graphics.Bitmap;
import android.os.Parcel;
import android.os.Parcelable;

public class ParcelableSmsPicture implements Parcelable {

	private SmsPicture smsPicture;
	
	
	public SmsPicture getSmsPicture() {
		return smsPicture;
	}

	public void setSmsPicture(SmsPicture smsPicture) {
		this.smsPicture = smsPicture;
	}
	

	public ParcelableSmsPicture(SmsPicture smsPicture) {
		super();
		this.smsPicture = smsPicture;
	}
	
	
	public ParcelableSmsPicture() {
		super();
	}
	
	private ParcelableSmsPicture(Parcel in){
		 smsPicture= new SmsPicture();
		 smsPicture.set_text(in.readString());
		 smsPicture.set_bitmap((Bitmap) in.readParcelable(Bitmap.class.getClassLoader()));
		
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeString(smsPicture.get_text());
		dest.writeParcelable(smsPicture.get_bitmap(), PARCELABLE_WRITE_RETURN_VALUE);
	}
	
	public static final Parcelable.Creator<ParcelableSmsPicture> CREATOR  = new Parcelable.Creator<ParcelableSmsPicture>() {

		@Override
		public ParcelableSmsPicture createFromParcel(Parcel source) {
			// TODO Auto-generated method stub
			return new ParcelableSmsPicture(source);
		}

		@Override
		public ParcelableSmsPicture[] newArray(int size) {
			// TODO Auto-generated method stub
			return new ParcelableSmsPicture[size];
		}
	};

}
